#ifndef MAINWINDOW_H
#define MAINWINDOW_H
//
#include "ui_mainwindow.h"
#include <QMainWindow>
#include <QFileDialog>
#include <QLabel>
#include <QToolBar>
class Arkanoid;
//
class mainWindow: public QMainWindow, public Ui::MainWindow
{
Q_OBJECT
private:
        Arkanoid *gbd;
	QLabel *blocks, *lifes, *score;
	QToolBar *colors;
	static QString version;
	bool campaign;
	QStringList levels;
	QString cntn;
	void beginLevel(QString lvl, int lifes_c=3, int score_c=0);
	void beginEdit(QString lbl);
	inline QString getLevelFN() { return QFileDialog::getOpenFileName(this, QString::fromUtf8("Выберите файл уровня"), QDir::currentPath() + "/levels/", QString::fromUtf8("Файлы уровней (*.lvl)")); };
	QStringList getCompleted();
	void addCompleted(QString lvl);
	void createLevelsMenu();
public:
	mainWindow(QWidget *parent=0, Qt::WFlags f=0);
	~mainWindow();
        inline void setTitle(QString ttl) { setWindowTitle("Arkanoid" + (!ttl.isEmpty() ? " - " + ttl : "")); };
	void addColor(QString clr);
	void setDefColor(QString clr);
public slots:
	inline void setPauseText() { actionPause->setText(QString::fromUtf8("Пауза")); };
	void onStop();
	inline void setBlocksCount(int cnt) { blocks->setText(QString::fromUtf8("Блоков: ") + QString::number(cnt)); };
	inline void setLifesCount(int cnt) { lifes->setText(QString::fromUtf8("Жизней: ") + QString::number(cnt)); };
	inline void setScoreCount(int cnt) { score->setText(QString::fromUtf8("Счёт: ") + QString::number(cnt)); };
	void win();
private slots:
	void on_actionHelp_triggered();
        void on_menuCont_triggered(QAction* action);
        void on_actionENew_triggered();
	void on_actionEOpen_triggered();
	void on_actionESave_triggered();
	void on_actionESaveAs_triggered();
	void on_actionEFinish_triggered();
        void on_actionOwn_triggered();
	void on_actionPause_triggered();
	void on_actionStop_triggered();
	void on_actionNew_triggered();
	void setDefColor() { setDefColor(qobject_cast<QAction*>(sender())->text()); };
};

#endif


